<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>函数的嵌套</title>
</head>
<body>
<script>
    function foo() {
        alert("第1层");
        function foo1() {
            alert("第2层");
            function foo2() {
                alert("第3层");
                function foo3() {
                    alert("第4层");

                }

                foo3()
            }

            foo2()
        }

        foo1()
    }
    foo()
</script>
</body>
</html>